<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      Father.prototype = {
        name: 'hahaha',
        sum: [1, 2, 3, 4],
      };
      function Father() {}
      var father = new Father();
      console.log(father); //
      father.name = 'aoliao'; //值类型直接加在实例的属性上而不是原型链上
      console.log(father);
      father.sum[0] = 30; //引用类型会从原型链上更改
      console.log(father);
    </script>
  </body>
</html>
